<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    /* .box{
        width: 840px;
        height: 420px;
        padding: 100px 250px;
        box-sizing: border-box;
        
    } */
</style>
<body>
    <!-- <div class="box">
        <p>2403抽奖会</p>
        <H1><span class="one">一等奖</span>???</H1>
        <h2><span class="two">二等奖</span>???</h2>
        <h3><span class="three">三等奖</span>???</h3>
    </div> -->
    <script>
    // const personArr = ['周杰伦','刘德华','周星驰','范老师','张学友']
    
    
    // const span1 = document.querySelector('.one')
    // const ran1 = Math.floor(Math.random()*personArr.length)
    // span1.innerHTML = personAll[ran1]
    // personArr.splice(ran1,1)
    // document.write(personArr)

    
    // const span2 = document.querySelector('.two')
    // const ran2 = Math.floor(Math.random()*personArr.length)
    // span2.innerHTML = personArr[ran2]
    // personArr.splice(ran2,1)
    // document.write(personArr)


    // const span3 = document.querySelector('.three')
    // const ran3 = Math.floor(Math.random()*personArr.length)
    // span3.innerHTML = personArr[ran3]
    // personArr.splice(ran3,1)
    // document.write(personArr)



    const personAll = ['周杰伦','刘德华','周星驰','范老师','张学友']


    const index1= Math.floor(Math.random()*personAll.length);
    const randomPerson1= personAll[index1]
    personAll.splice(index1,1)


    const index2= Math.floor(Math.random()*personAll.length);
    const randomPerson2= personAll[index2]
    personAll.splice(index2,1);

    const index3= Math.floor(Math.random()*personAll.length);
    const randomPerson3 = personAll[index3]

    document.write('一等奖是:',randomPerson1)
    document.write(`<br>`)
    document.write('二等奖是:',randomPerson2)
    document.write(`<br>`)
    document.write("三等奖是:",randomPerson3)
        // const personAll = ['周杰伦','刘德华','周星驰','范老师','张学友']
    // const select = Math.floor(Math.random()*personAll.length);
    // const randomPerson1= personAll[select]
    // personAll.splice(randomPerson1-1,1)
    // const randomPerson2 = personAll[select]
    // personAll.splice(randomPerson2-1,1)
    // const randomPerson3 = personAll[select]
    // document.write('一等奖是:',randomPerson1)
    // document.write(`<br>`)
    // document.write('二等奖是:',randomPerson2)
    // document.write(`<br>`)
    // document.write("三等奖是:",randomPerson3)
</script>
</body>
</html>